package com.zenith.zongheng.demo.controller;

import com.zenith.zongheng.auth.api.AuthClientService;
import com.zenith.zongheng.auth.api.AuthService;
import com.zenith.zongheng.auth.constant.AuthResultConstant;
import com.zenith.zongheng.auth.domain.entity.AuthUserinfo;
import com.zenith.zongheng.auth.exception.AuthException;
import com.zenith.zongheng.core.exception.BaseBusinessException;
import com.zenith.zongheng.core.result.BaseResultConstant;
import com.zenith.zongheng.core.result.R;
import com.zenith.zongheng.core.util.IPUtil;
import com.zenith.zongheng.core.util.StringUtil;
import oracle.jdbc.proxy.annotation.Post;
import org.apache.dubbo.config.annotation.Reference;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.*;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping({"/test"})
public class testController {
    @Autowired
    @Reference
    private AuthService authService;
    @Autowired
    @Reference
    private AuthClientService authClientService;

    @PostMapping({"/test"})
    public void logout(HttpServletRequest request)
    {   System.err.println("11111111111");
        String token = StringUtil.defaultString(request.getHeader("token"));
        System.err.println(this.authClientService.getUserSession(token).getId());
        // return R.ok();
    }

}
